<!--
 * @Description:  
 * @Author: YiHe
 * @Date: 2020-07-03 08:41:38
 * @LastEditors: YiHe
 * @LastEditTime: 2020-08-15 11:51:53
-->
<template>
	<view class="container" @tap="tap">
		<view v-if="!toHome" class="back"><image class="img" src="../../static/icon/back.png" mode="widthFix"></image></view>
		<view v-if="toHome" class="home"><u-icon name="home"></u-icon></view>
	</view>
</template>

<script>
export default {
	props: {
		toHome: {
			type: Boolean,
			default: false
		}
	},
	methods: {
		tap: function() {
			if (this.toHome) {
				this.$Router.pushTab({ name: 'topic' })
				return
			}
			this.$Router.back(1)
		}
	}
}
</script>

<style scoped lang="stylus">
.container
	position fixed
	top 90rpx
	left 55rpx
	z-index 99
	width 60rpx
	height 60rpx

	view
		width 70rpx
		height 70rpx
		font-size 40rpx
		display flex
		justify-content center
		align-items center
		color white
		filter drop-shadow(0 0 2rpx gray)
		border-radius 50%

	.back
		background white

		image
			width 20rpx
			height auto
			filter brightness(5%)
			margin-left -5rpx
	.home
		background #FFC258
</style>
